//
//  PaymentModel.m
//  project
//
//  Created by 张亚林 on 2017/11/7.
//  Copyright © 2017年 Macmini. All rights reserved.
//

#import "PaymentModel.h"

#import "NSObject+MJExtension.h"
#import "HGNetworkingRequest.h"

//{
//    code = 0000;
//    data =     (
//                {
//                    alias = "\U4e2d\U884c";
//                    bankName = "\U4e2d\U56fd\U5efa\U8bbe\U94f6\U884c";
//                    branchName = "\U5f00\U5143\U8def\U652f\U884c";
//                    collectionAddr = "979911574@qq.com";
//                    collectionType = 1;
//                    createTime = 1510047944000;
//                    id = 69;
//                    isDel = 0;
//                    ownerId = 40;
//                    ownerIsUser = 1;
//                    ownerName = "\U5f20\U4e9a\U6797";
//                    remark = "<null>";
//                    updateTime = 1510047944000;
//                }
//                );
//    msg = OK;
//}



@implementation PaymentModel

+ (void)getPaymentAddressListWithcomplection:(void (^)(NSMutableArray *))complection {
    
    [[HGNetworkingRequest shareRequest] startGetRequest:api_user_getPaymentAddressList parameter:nil showNetworkErrorAlert:YES onCompletion:^(id jsonResponse) {
        
//        NSDictionary *responseDic = (NSDictionary *)jsonResponse;
//        NSString *result = [responseDic objectForKey:@"code"];
//        if ([result isEqualToString:@"0000"]) {
//
//             NSArray *array = jsonResponse[@"data"];
//             NSMutableArray *arrayM = [NSMutableArray arrayWithCapacity:array.count];
//            for (NSDictionary *dict in array) {
//                [arrayM addObject:[PaymentModel parse:dict]];
//            }
//            dispatch_async(dispatch_get_main_queue(), ^{
//                //回调或者说是通知主线程刷新，
//                complection(arrayM);
//            });
//
//        }

    } onError:^(id jsonResponse) {
         NSLog(@"error = %@", jsonResponse);
    }];
}

@end
